package pl.edu.agh.abd.hsm;

import java.io.IOException;
import org.codehaus.jackson.map.ObjectMapper;
import org.restlet.resource.ClientResource;
import org.restlet.resource.ResourceException;

public class SimpleClient {
	public static void main(String[] args) throws InterruptedException {
		// Create the client resource  
		ClientResource resource = new ClientResource("http://localhost:8182/estimator/asdfdddasdf");  
		
		// Customize the referrer property  
		resource.setReferrerRef("http://www.mysite.org");  
		// Write the response entity on the console
		try {
			ObjectMapper mapper = new ObjectMapper();
			EstimatorResponse es = mapper.readValue(resource.get(String.class), EstimatorResponse.class);
			System.out.println(es.getResourceName());
		} catch (ResourceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		Thread.sleep(10000);
	}
}
